﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:uc="clr-namespace:FileExplorer.WPF.UserControls">
    <ResourceDictionary.MergedDictionaries>
        
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type uc:StackPanelView}, ResourceId=stackPanelViewDSK}" 
                                        TargetType="{x:Type ListView}" BasedOn="{StaticResource {x:Type ListBox}}"
       >
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>

        <Setter Property="ItemContainerStyle" 
          Value="{Binding (ListView.View).ItemContainerStyle,
          RelativeSource={RelativeSource Self}}"/>

        <Setter Property="ItemTemplate" 
          Value="{Binding (ListView.View).ItemTemplate,
          RelativeSource={RelativeSource Self}}"/>

        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel 
                        IsItemsHost="True"
                        Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}" 
                        Height="{Binding (FrameworkElement.ActualHeight), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}" 
                        Orientation="{Binding (ListView.View).Orientation, RelativeSource={RelativeSource AncestorType=ListView}}"                      
                        />                    
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>




</ResourceDictionary>